package  
{
	import flash.display.MovieClip;
	
	/**
	 * ...
	 * @author ...
	 */
	public class Aura extends MovieClip 
	{
		
		public static var auras : Array = new Array();
		private var aceleration : int = 15;
		
		public function Aura() 
		{
			
		}
		
		public static function update()
		{
			if (auras.length > 0)
			{
				for (var i: int = 0; i < auras.length; i++)
				{
					auras[i].width = auras[i].height += auras[i].aceleration;
					auras[i].alpha -= 0.05
					auras[i].aceleration -= 1;
					
					if (auras[i].alpha <= 0)
					{
						Main.instance.tela.removeChild(auras[i]);
						auras.splice(i, 1);
					}
				}
			}
		}
		
		public static function createAura(elementalState: ElementalState)
		{
			var aura = new Aura();
			aura.gotoAndStop(elementalState.label);
			aura.x = Main.instance.personagem.x;
			aura.y = Main.instance.personagem.y;
			aura.width = aura.height = 10;
			Main.instance.tela.addChild(aura);
			auras.push(aura);
		}
		
	}

}